package basic.chapter9;

/**
 * @author Kevin
 * @date 2020/2/22 15:35
 */
public class Test {
    public static void main(String[] args) {
        Thread th = Thread.currentThread();
        while(true) {
            if (th.isInterrupted()) break;

            //省略业务代码无数
            try {
                Thread.sleep(100);
                System.out.println("Sleep");
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                e.printStackTrace();
            }
        }
    }
}
